package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.store.awk.bean.HorizonalHomeCardItemBean;
import java.util.Arrays;
import java.util.Locale;
import kotlin.Metadata;
import o.ewm.i;
import o.fsd;
import o.fsn;
import o.ftk;
import o.ftm;
import org.jetbrains.annotations.NotNull;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/huawei/appmarket/service/store/awk/card/ThreeLineAppSingleItemCard;", "Lcom/huawei/appmarket/service/store/awk/card/HorizontalApplistSingleItemCard;", "context", "Landroid/content/Context;", "(Landroid/content/Context;)V", "setIntro", "", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
public final class ThreeLineAppSingleItemCard extends HorizontalApplistSingleItemCard {
    public ThreeLineAppSingleItemCard(@NotNull Context context) {
        fsd.ˊ((Object) context, "context");
        super(context);
    }

    public void x_() {
        CardBean cardBean = this.ˊᐝ;
        if (!(cardBean instanceof HorizonalHomeCardItemBean)) {
            cardBean = null;
        }
        HorizonalHomeCardItemBean horizonalHomeCardItemBean = (HorizonalHomeCardItemBean) cardBean;
        if (horizonalHomeCardItemBean != null) {
            switch (horizonalHomeCardItemBean.ꞌ()) {
                case 0:
                    TextView textView = this.ˉ;
                    if (textView != null) {
                        textView.setText(horizonalHomeCardItemBean.ˏˏ());
                        return;
                    }
                    return;
                case 4:
                    String str;
                    String ʹ = horizonalHomeCardItemBean.ʹ();
                    Float ˎ = ʹ != null ? ftk.ˎ(ʹ) : null;
                    if (ˎ == null) {
                        str = null;
                    } else {
                        int ceil = (ˎ.floatValue() >= 1.0f || ˎ.floatValue() <= 0.0f) ? (int) ((float) Math.ceil((double) ˎ.floatValue())) : 2;
                        fsn o_fsn = fsn.ॱ;
                        Locale locale = Locale.ENGLISH;
                        fsd.ॱ(locale, "Locale.ENGLISH");
                        Object[] objArr = new Object[]{ˎ};
                        fsd.ॱ(String.format(locale, "%.1f", Arrays.copyOf(objArr, objArr.length)), "java.lang.String.format(locale, format, *args)");
                        Context context = this.ʼॱ;
                        fsd.ॱ(context, "mContext");
                        str = context.getResources().getQuantityString(i.ˎˎ, ceil, new Object[]{ʹ});
                    }
                    ʹ = horizonalHomeCardItemBean.ﹳ();
                    if (ʹ == null) {
                        ʹ = "";
                    }
                    fsd.ॱ(ʹ, "cardBean.downCountDesc_ ?: \"\"");
                    TextView textView2 = this.ˉ;
                    if (textView2 != null) {
                        CharSequence charSequence;
                        if (str == null || ftm.ˋ(ʹ)) {
                            String str2;
                            if (str != null) {
                                str2 = str;
                            } else if (ftm.ˋ(ʹ)) {
                                str2 = horizonalHomeCardItemBean.ˏˏ();
                            } else {
                                str2 = ʹ;
                            }
                            charSequence = str2;
                        } else {
                            charSequence = str + " · " + ʹ;
                        }
                        textView2.setText(charSequence);
                        return;
                    }
                    return;
                default:
                    super.x_();
                    return;
            }
        }
    }
}
